9 var button, synth, server;
12 |name, bounds, server|
13 ^super.new(name, bounds).init(server);
20 SynthDef(\demoSynth, {
23 env = EnvGen.kr(Env.adsr(0, 0, 1, 0), gate: gate, doneAction: 2);
24 Out.ar(out, [SinOsc.ar(1000), SinOsc.ar(1500)] * env * 0.125);
27 button = SCButton(this, Rect(
28 (this.bounds.width - buttonWidth) * 0.5,
29 (this.bounds.height - buttonHeight) * 0.5,
34 ["Hit me!", Color.black, Color.gray],
35 ["Make it stop!", Color.black, Color.red]
39 theButton.value.switch(
40 1, { synth = Synth.new(\demoSynth, target: server) },
41 0, { synth.set(\gate, 0.0) }